<!--头部版块-->
<app-page-header [pageHeaderInfo]="pageHeaderInfo" />

<div class="normal-table-wrap">
  <nz-card class="m-b-10" nzHoverable [nzBodyStyle]="{ 'padding-bottom': 0 }">
    <form nz-form>
      <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24 }">
        <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
          <nz-form-item>
            <nz-form-label [nzFor]="">角色名称</nz-form-label>
            <nz-form-control>
              <input name="roleName" nz-input placeholder="请输入角色名称" [(ngModel)]="searchParam.roleName" />
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8"></div>
        <div class="text-right p-0 m-b-10" nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
          <button nz-button [nzType]="'primary'" (click)="getDataList({ pageIndex: 1 })">
            <i nz-icon nzType="search"></i>
            搜索
          </button>
          <button class="m-l-15" nz-button (click)="resetForm()">
            <i nz-icon nzTheme="outline" nzType="close-circle"></i>
            重置
          </button>
        </div>
      </div>
    </form>
  </nz-card>

  <app-card-table-wrap [btnTpl]="tableBtns" [tableTitle]="'角色列表'" (reload)="reloadTable()">
    <app-ant-table [tableConfig]="tableConfig" [tableData]="dataList" (changePageIndex)="getDataList($event)" (changePageSize)="changePageSize($event)"></app-ant-table>
    <ng-template #operationTpl let-$$dataItem="$$dataItem" let-id="id" let-roleName="roleName">
      <span class="operate-text" (click)="setRole(id, roleName)">设置权限</span>
      <span *appAuth="ActionCode.RoleManagerEdit" class="operate-text" (click)="edit(id, $$dataItem)">编辑</span>
      <span *appAuth="ActionCode.RoleManagerDel" class="operate-text" (click)="del(id)">删除</span>
    </ng-template>
  </app-card-table-wrap>
</div>

<ng-template #tableBtns>
  <button class="m-r-8" nz-button nzType="primary" (click)="add()">
    <i nz-icon nzType="plus"></i>
    新建
  </button>
</ng-template>
